// 判断是不是http链接
export function isHttpOrHttpsLink(url: string | URL) {
  let urlObj: URL;
  try {
    urlObj = new URL(url);
  } catch (_) {
    return false; // 如果URL无效，则不是http或https链接
  }
  return urlObj.protocol === 'http:' || urlObj.protocol === 'https:';
}
